package net.htjs.juc.jmm;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class RunDemo {

    static boolean run = true;
    public static void main(String[] args) {
        new Thread(() -> {
            while(run) {
                log.info("running...");
            }
        }).start();
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        log.info("end");
        run = false;
    }
}
